package com.ruoyi.common.utils.file;

import io.lettuce.core.dynamic.annotation.Value;
import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 创建Minio客户端
 */
@Configuration
public class MinioConfig {

    private final String accessKey="admin";

    private final String secretKey="admin123456";

    private final String url="http://122.51.84.231:9001";

    /**
     * 注入客户端
     */
    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .credentials("accessKey", "secretKey")
                .endpoint(url)
                .build();
    }
}